import {
  Controller,
  Get,
  NotFoundException,
  UseInterceptors,
} from '@nestjs/common';
import {

  ErrorResponse,
  PaginatedResponse,
  SuccessResponse,
  TransformInterceptor,
} from '../../util/ResultResponse';
import { SysUser } from '../../auth/entities/auth.entity';


@Controller('/test')
 export class TestController {
  // 成功响应示例
  @Get('/aa:id')
  getUserById(): SuccessResponse<SysUser> {
    const  sys = new SysUser();
    sys.id = 1;
    return  { code: 0, data: sys, message: '' };
  }

  // 错误响应示例
  @Get('/ee:id')
  getUserById1(): ErrorResponse {
    throw new NotFoundException('用户未找到');
  }

  // 分页响应示例
  @Get('/ss')
  getAllUsers(): PaginatedResponse<SysUser> {
    return { code: 0, data: [], message: '', total: 0 };
  }
}